#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>



int main()
{
    pid_t id = fork();
    if(id == 0)
    {
       // child
       printf("I am a child , my PID:%d\n",getpid());
       execl("/usr/bin/ls","-l","-a",NULL);

       printf("okl");
    }  
    else 
    {
        pid_t rid = waitpid(-1,NULL,0);
        if (rid > 0)
        {
            printf("wait succes!! PID:%d\n",rid);
        }
    }
    return 0;
}
